<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //浅拷贝和深拷贝只针对引用类型
    //浅拷贝，拷贝的是地址,多层拷贝就有问题了
    //
    const obj = {
        uname:'pink',
        age:18,
        family:{
            baby:'小pink'
        }
    };
    // const o = {...obj}
    // o.age = 20;
    // console.log(o);
    // console.log(obj);
    //

    const o = {}
    Object.assign(o,obj);
    o.age = 20
    console.log(o);
</script>
</html>